<%@ include file="header.jsp" %>
<script type="text/javascript">
function submitform(image)
{
	imageOld =  document.getElementById("image").value;
	i = imageOld.lastIndexOf("\\");
	imageOld = imageOld.substring(i+1, imageOld.length+1);
	document.getElementById("image").value = imageOld;
	if (document.getElementById("imageNew").value != "") 
	{ document.getElementById("image").value = document.getElementById("imageNew").value; }
	document.formulaire.submit();
	
}
</script> 

			<br /><br />
			<h1> Modifier un film </h1><br /><br />
						
						<form name='formulaire' action='modifFilm!modifier' method='post'>
						<input type="hidden" id="idFilm" name="idFilm" value="<c:out value="${idFilm}"/>"/>
						<input type="hidden" id="image" name="image" value="<c:out value="${image}"/>"/>
						<input type="hidden" id="titre" name="titre" value="<c:out value="${titre}" />"/>
						<p>
						<img src='<c:out value="${image}" />'/>
						<input type="hidden" id="pathImage" name="pathImage" value="<c:out value="${image}"/>"/><br/><br/>
						<span>Titre : </span> <c:out value="${titre}"/><br /><br />
						<span>Auteur : </span><input type="text" name="auteur" value="<c:out value="${auteur}"/>"/><br /><br />
						<span>Genre : </span><select name="genre" value="<c:out value=""/>">
						  <option>Action</option>
						  <option>Aventure</option>
						  <option>Dramatique</option>
						  <option>Fantastique </option>
						  <option>Horreur </option>
						  <option>Thriller </option>
						  <option>5</option>
						</select>
						<br /><br />
						<span>Date de sortie : </span><input type="text" name="dateSortie" value="<c:out value="${dateSortie}"/>"/><br /><br />
						<span>Duree : </span><input type="text" name="duree" value="<c:out value="${duree}"/>"/><br /><br />
						<span>Image : </span><input type="file" id ="imageNew" name="imageNew" value="<c:out value="${image}"/>"/><br /><br />
						<table border="1">
							<tr>
								<td><span>Resume : </span></td>
								<td><textarea name="resume" cols="50" rows="7"><c:out value="${resume}"/></textarea></td>
							</tr>
						</table>
						<br /><br />
						<span>Note : </span><select name="note" value="<c:out value="${note}"/>">
						  <option>0</option>
						  <option>1</option>
						  <option>2</option>
						  <option>3</option>
						  <option>4</option>
						  <option>5</option>
						</select>
					</p><br/>
						<table border="1">
							<tr>
								<td><html:reset value="annuler"/></td>
								<td><input type="button" value="envoyer" onclick="javascript:submitform();"/></td>
							</tr>
						</table>
				</form>
		
			<br/><br/><br/>
<%@ include file="footer.jsp" %>